From: Ian Jackson Date: Tue, 11 Jan 2011 19:28:22 +0000 (+0000) Subject: libxl: config parser: do not segfault in some error paths X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~10935 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=1d80237d14c9bf7be01325765c35b5809ce0030e;p=xen.git libxl: config parser: do not segfault in some error paths In error paths, xlu__cfg_set_free can be called on NULL. So check for that rather than segfaulting. Signed-off-by: Ian Jackson --- diff --git a/tools/libxl/libxlu_cfg.c b/tools/libxl/libxlu_cfg.c index 864a723009..1ade7eacda 100644 --- a/tools/libxl/libxlu_cfg.c +++ b/tools/libxl/libxlu_cfg.c @@ -93,6 +93,7 @@ int xlu_cfg_readdata(XLU_Config *cfg, const char *data, int length) { void xlu__cfg_set_free(XLU_ConfigSetting *set) { int i; + if (!set) return; free(set->name); for (i=0; invalues; i++) free(set->values[i]);